import request from '@/utils/request'

export const getPolicyList = () => {
  return request({
    url: '/vm-service/policy'
  })
}

/**
 * 批量修改策略
 */
export const applyPolicy = (data) => {
  return request({
    url: '/vm-service/vm/applyPolicy',
    method: 'PUT',
    data
  })
}

/**
 * 查询售货机策略
 */
export const searchPolicy = (innerCode) => {
  return request({
    url: `/vm-service/policy/vmPolicy/${innerCode}`
  })
}

/**
 * 取消策略
 */
export const delPolicy = (innerCode, policyId) => {
  return request({
    url: `/vm-service/vm/cancelPolicy/${innerCode}/${policyId}`,
    method: 'put'
  })
}
